### Event Elements

- <do> tag - The <do> tag is a card-level user interface. It serves as a general mechanism to activate a task, usually performed by the user clicking a word or phrase in the display. A task is performed in response to an event. There are four tasks in WML: go, noop, prev, and refresh.

The mandatory type attribute provides information about the intent of the element, helping to improve processing. If the Web browser does not recognize the specified type, the specified type is treated as unknown. For example, testing, experimental, and vendor specific types would be unknown.

Attribute | Value | Description | Comments
--- | --- | --- | ---
type | accept prev help reset options delete unknown x-* vnd.* | REQUIRED. Defines the type of the “do” element. | SUPPORTED.
label | cdata | Creates a label for the “do” element. | Optional. Creates a string label for the element. The telephone browser imposes a six character limit. SUPPORTED.
name | mmtoken | Defines a name for the “do” element. | SUPPORTED.
optional | true false | If set to true, the browser ignores this element. If set to false, the browser does not ignore this element. Default is “false.” | Optional. SUPPORTED.

Type | Description | Comments
--- | --- | ---
accept | Acknowledgement of acceptance. | SUPPORTED.
delete | Delete item. | SUPPORTED.
help | Request for help. | SUPPORTED.
options | Options or additional operations. | SUPPORTED.
prev | Backward navigation. | SUPPORTED.
reset | Clearing or reset. | SUPPORTED.
X-*n or x-*n | Experimental. | NOT SUPPORTED.
Vnd* | Any mix of upper or lower cases. Vendor-specific. | Unknown.

<do> tags are rendered as centered softkey labels on the bottom display line. <do> tags are specified per WML page and therefore are page context-sensitive. <do> tags with an unspecified name attribute default to the <type> attribute value. A <do> tag with a <noop> tag embedded within renders the <noop> on a softkey, but pressing that softkey has no effect. The eight “do” types are labeled either specifically in a WML page or by a browser-dependent label.

If no labels are given, then the “do” types have the following default labels:

Type | Default Label if no label specified
--- | ---
accept | Accept
delete | Delete
help | Help
options | Options
prev | Back
reset | Refresh
X-*n or x-*n | Unknown
Vnd* Any mix of upper or lower cases | AVAYA. Available for future use but currently Unknown.

If no <do> tags were specified, no softkeys display:

Home | Refresh | Stop |

If one <do> tag was specified, these softkeys display:

1st DO | Refresh | Stop | Home

If multiple <do> tags are specified, display them as follows:

1st DO | 2nd DO | 3rd DO | MORE

Page 1 softkeys:

1st DO | 2nd DO | 3rd DO | MORE

Page 2 softkeys:

4th DO | 5th DO | Etc. | MORE

NOTE: If more than one page of softkey labels are specified, pressing the MORE softkey automatically presents the user with the next page of labels. If the last page displays and the user presses the MORE softkey, the first page of labels displays. As implied in the examples, the Softkey buttons are labeled in sequential order of the <do> tags. When an image tag exists inside a <do> tag, and the attempt to retrieve the image through HTTP fails, the <do> tag label displays as the softkey label.

To render JPEG or WBMP images in the softkey label area, embed <img> tags in the <do> tag. For example:

    <do type="example-accept" label="SK1">

    <go href="example-#card2"/>

    <img src="x.jpg"/>

    <do>

To render JPEG or WBMP images in the softkey area, use the CSS2 property background-image with a <do> tag. The example that follows shows a <do> tag with embedded images. Notice that the <do> tag has an image that does not completely fit in Softkey 3. The default background color shows where the image does not cover the softkey label area.

The default value of “No image” is used for the Alt text when the image cannot be loaded on a softkey.

- <onevent> tag - The onevent tag serves as a container for code that you want executed automatically when one of the four intrinsic events occurs. The onevent element binds (associates) the tasks (code) to the event for the element. You must specify the intrinsic event using the mandatory type attribute.
  For example, when a user presses the BACK softkey, instead of being routed to the previous screen, the user is directed to another specified page because this tag carries out an onevent backward event.

The intrinsic events are:

Event | Permitted Tags | Description
--- | --- | ---
onenterbackward | card or template | Occurs when a <prev> navigates back onto a card. SUPPORTED.
onenterforward | card or template | Occurs when a <go> navigates into a card. SUPPORTED.
onpick | option | Occurs when a user selects/deselects an item. SUPPORTED.
ontimer | card or template | Occurs when the time expires. SUPPORTED.

The template element creates code that is inserted into all cards in a single deck. The nested tags are: go, noop, prev, and refresh. There are no visual implications for supporting the <onevent> tag. If there is more than one <onevent> tag defined with the same type in a deck/card, then only the last <onevent> tag will be rendered. Specifying more than one <onevent> tag inside an <anchor> tag is an error.

Attribute | Value | Description | Comments
--- | --- | --- | ---
type | onenterbackward onenterforward onpick ontimer | REQUIRED. Specifies the type of the “onevent” element. onenterbackward - Triggered when a <prev> goes to a previous card. onenterforward - Triggered when a <go> goes to a card. onpick - Triggered when an item is selected/unselected. ontimer - Triggered when a timer expires. | SUPPORTED.

- <postfield> tag - Use the postfield tag to set a name/value pair that can be transmitted during a URL request to an origin server, the request’s source. The name attribute sets the name, which must be a valid WML variable name. The value attribute sets the value. There are no visual rendering implications with this tag.

Attribute | Value | Description | Comments
--- | --- | --- | ---
name | cdata | REQUIRED. The name of the field. | SUPPORTED.
value | cdata | REQUIRED. The value of the field. | SUPPORTED.